<template>
  <div></div>
</template>
<script>
import Cookies from 'js-cookie'
import { message } from '@/utils/message'
export default {
  data() {
    return {
      fullscreenLoading: false
    }
  },
  created () {
    this.GetQueryString()
  },
  methods: {
    GetQueryString () {
      const loading = this.$loading({
        lock: true,
        text: 'Loading',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.7)'
      })
      let url = window.location.href
      let temp2 = url.split('?')[1]
      let pram2 = new URLSearchParams('?' + temp2)
      const token = pram2.get('JSESSIONID')
      if (token) {
        Cookies.set('token', token)
        Cookies.set('authorization', pram2.get('JSESSIONID'))
        Cookies.set('JSESSIONID', pram2.get('JSESSIONID'))
        this.$router.push('/')
        loading.close()
      } else {
          message({
            type: 'error',
            message: '登录失败'
          })
        }
      }
    }
}
</script>
